from __future__ import annotations
from typing import List

from gear import GearType, Gear

class GearInterface:
    def __init__(self, gear_type: List['GearType'], efficiency: float | None):
        """
        装备接口, 保存装备栏信息
        :param gear_type: 可用装备类型
        :param efficiency: 装备效率
        """
        self._gear_type = gear_type
        self._efficiency = efficiency
        self._gear = None

    def set_gear(self, gear: 'Gear'):
        """设置装备"""
        if gear is None:
            self._gear = None
        if gear.gear_type in self._gear_type:
            self._gear = gear
        else:
            raise ValueError("装备类型不符")
